package com.jhhc.StormSurgeForecast.AstronomicalTide.Dao;


import com.jhhc.StormSurgeForecast.AstronomicalTide.Pojo.BDMS_CALCULATESCHEME_M1;
import com.jhhc.StormSurgeForecast.AstronomicalTide.Pojo.TyphoonBO.TyphoonCschemeInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BDMS_CALCULATESCHEME_M1Mapper {

    //根据方案编号获取计算方案
    BDMS_CALCULATESCHEME_M1 selcalSchemeId(@Param("calSchemeId") String calSchemeId);

    BDMS_CALCULATESCHEME_M1 selectShcemeByCalID(@Param("calSchemeId") String calSchemeId);
    List<BDMS_CALCULATESCHEME_M1> selectShcemeByCalIds(@Param("calSchemeIds") List<String> calSchemeIds);
    //查询已保存的计算方案
    List<BDMS_CALCULATESCHEME_M1> selectShcemeFlagByCalID(@Param("calSchemeId") String calSchemeId);

    //根据项目id方案编号获取
    List<BDMS_CALCULATESCHEME_M1> selectShcemeByPidCalID(@Param("project") Integer project,@Param("calSchemeId") String calSchemeId);

    int deleteCalById(@Param("calSchemeIds") List<String> calSchemeIds);

    //保存计算方案
    int saveCalSchemeInfo(BDMS_CALCULATESCHEME_M1 bdms_calculatescheme_m);

    //方案入库
    int insertBdmsCalculateschemeM(BDMS_CALCULATESCHEME_M1 bdms_calculatescheme_m);
    int updateGen(String cschemeid,int gen);
    BDMS_CALCULATESCHEME_M1 selectByNewOne();

    BDMS_CALCULATESCHEME_M1 selectNewOneByModel(String modelId );

    BDMS_CALCULATESCHEME_M1 selectNewOneByPidModel(int projectId,String tfId,String modelId ,String area);
    BDMS_CALCULATESCHEME_M1 selectByNewOneMySql();

    BDMS_CALCULATESCHEME_M1 selectNewOneByModelMySql(String modelId,String startTime,String endTime);

    BDMS_CALCULATESCHEME_M1 selectNewOneByPid(@Param("pid") Integer pid);

    BDMS_CALCULATESCHEME_M1 selectNewOneByPidMysql(@Param("pid") Integer pid);


    //根据日期和台风编号获取多个预报方案
    List<BDMS_CALCULATESCHEME_M1> selectShcemeByPidDate(@Param("projectId") Integer projectId,@Param("tfId") String tfId
                                ,  @Param("startTime") String startTime, @Param("endTime") String endTime,
                                                        @Param("IsPublished") String IsPublished ,@Param("status") String status
                                                        ,@Param("forecaster") String forecaster,@Param("path") String path
            ,@Param("flag") String flag,String modelId);


    List<BDMS_CALCULATESCHEME_M1> selectShcemeByPidDateSqlserver(@Param("projectId") Integer projectId,@Param("tfId") String tfId
            ,  @Param("startTime") String startTime, @Param("endTime") String endTime,
                                                        @Param("IsPublished") String IsPublished,@Param("status") String status
            ,@Param("forecaster") String forecaster,@Param("path") String path,@Param("flag") String flag, String modelId);

    int updataByCschemeid(@Param("flag") int flag,@Param("cschemeid") String cschemeid);


    List<TyphoonCschemeInfo> getRealPaths(@Param("projectId") int projectId);

    /**
     * 修改计算状态
     */
    int updateStatus(@Param("state") String state, @Param("cschemeId") String cschemeId);

    /**
     * 修改保存场数据状态
     */
    int updateArea(@Param("area") String area, @Param("cschemeId") String cschemeId);

    int deleteByCschemeId(@Param("cschemeId") String cschemeId);
    int deleteByFschemeId(@Param("fschemeId") String fschemeId,@Param("tag") String tag);
    List<String> selectCschemeId(@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("projectId") String projectId);

}

